home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Speccy ClassiX 1998
/
Speccy ClassiX 98.iso
/
amiga_system
/
the_aminet
/
comm
/
mebbs
/
adrtcdrom2_9.lha
/
adrtcdrom.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1995-09-04
|
9KB
|
326 lines
/* ADRTCDROM Utility Written by Andrew Rooney (c) 1995 ADRT Software
UnderWorld Elements BBS (403)346-1816
$VER: ADRTCDROM 2.9 (3.8.95) (c) 1995 ADRT Software
*/
if ~show("L","mebbsarexx.library") then do;call addlib("mebbsarexx.library",0,-30,0);end
Signal ON ERROR;Signal ON SYNTAX;Signal ON IOERR
Parse Arg Line freqlist .;Door = "ADRTCDROM"
Call Pragma("W","N")
if upper(line) = "LIST" | upper(line) = "GUIDE" then Signal ON break_c
if upper(line) = "LIST" | upper(line) = "GUIDE" then call findcd
Call GetVar Door,Line,20;access = Result
Call GetVar Door,Line,8;Mode = Result
Call GetVar Door,Line,10;Hight = Result
ESC = "1B"x
RED = "";GRN = "";YLW = "";BLU = "";PUR = "";CYN = "";WHT = ""
If Mode = 1 then do
RED = ESC"[31m";GRN = ESC"[32m";YLW = ESC"[33m";BLU = ESC"[34m";PUR = ESC"[35m";CYN = ESC"[36m";WHT = ESC"[37m"
End
findcd:
f=0
Do i = 1 to 300
If Exists("MEBBSNet:Rexx/ADRTCDROM/"i".cfg") then do
Call Open config, ("MEBBSNet:Rexx/ADRTCDROM/"i".cfg"), "R"
DLAccess = readln(config)
readaccess = readln(config)
CD = readln(config)
If exists(CD) then do
CDDesc = readln(config)
ListType = readln(config)
Do while ~EOF(config)
f = f + 1
AreaDesc.f = readln(config)
ListPath.f = readln(config)
FilePath.f = readln(config)
End
call close(config)
call begin
End
End
Call Close(config)
End
if upper(line) = "LIST" | upper(line) = "GUIDE" then do
Say;Say 'There is currently no configured CD-ROM in the Drive...';say
Exit
End
Call Message Door,Line,"0c"x""YLW""Centre("Sorry, No CD Available At This Time",79),1
Call Message Door,Line,,1
Call Hotkey Door,Line,WHT"Press Any Key to Continue..."
call ERROR
Begin:
if upper(line) = "LIST" | upper(line) = "GUIDE" Then call MakeList
if access < readaccess then call noaccess
Call Message Door,Line,"0c"x,0
Call Message Door,Line,YLW""Centre("ADRT MEBBSNet CD-ROM Download Utility v2.9",79),1
Call Message Door,Line,BLU""Centre("Written By Andrew Rooney",79),1
Call Message Door,Line,"",1
Call Message Door,Line,BLU"Name Of CD : "WHT""Left(CD,Length(CD)-1),1
Call Message Door,Line,BLU"Description: "WHT""CDDesc,1
Call Message Door,Line,"",1 ; Call Message Door,Line,"",1
disp = 0 ; count = 0
Do m = 1 to f
disp = disp + 1
if length(m) = 1 then do
Call Message Door,Line," ",0
end
Call Message Door,Line,BLU"["WHT""m""BLU"] "WHT""Left(AreaDesc.m,25)" ",0
If disp = 2 then do
Call Message Door,Line,"",1 ; disp = 0
count = count + 1
If count = Hight then do
Call Hotkey Door,Line,"More? (Y/n) "
if Upper(result) = "N" then call CDPrompt
count = 0
End
End
End
Call Message Door,Line,"",1
CDPrompt:
Call Message Door,Line,"",1
Call Message Door,Line,GRN"["WHT"S"GRN"]"WHT"earch for file",1
Call Message Door,Line,,1
Call Prompt Door,Line,YLW"Selection? [RETURN]=Quit: ",7
z = result
if z = "NULL" then Call ERROR
if upper(z) = "S" then call Search
if z = 0 then call CDPrompt;if z < 0 then call CDPrompt;if z > f then call CDPrompt
Path = FilePath.z;List = ListPath.z
If mode = 1 then do
Call Message Door,Line,"0c"x,0
End
If Upper(ListType) = "FILESBBS" then do
call open FileList, (List), "R"
b = 0 ; count = 0
FileString = ReadLn(FileList)
Do while ~EOF(FileList)
b = b + 1
NMBR = b
Filename.b = left(FileString,26) ; Desc.b = right(FileString,46)
if length(b) = 1 then do
call message Door,Line," ",0
end
Call Message Door,Line,BLU"["WHT""NMBR""BLU"] "GRN""FileName.b""CYN""Desc.b,1
count = count + 1
If count = Hight then do
Call Hotkey Door,Line,YLW"More? (Y/n) "
if upper(result) = "N" then call DLPrompt
Call Message Door,Line,"",1
count = 0
End
FileString = ReadLn(FileList)
End
End
If Upper(ListType) = ADRTCD then do
call open FileList, (List), "R"
b = 0 ; count = 0
Filename.b = ReadLn(FileList)
Desc.b = Readln(FileList)
Do while ~EOF(FileList)
b = b + 1
if length(b) = 1 then do
call message Door,Line," ",0
end
Filename.b = left(FileName.b,26) ; Desc.b = right(Desc.b,46)
Call Message Door,Line,BLU"["WHT""b""BLU"] "GRN""FileName.b""CYN""Desc.b
count = count + 1
If count = Hight then do
Call Hotkey Door,Line,YLW"More? (Y/n) "
if upper(result) = "N" then call DLPrompt
count = 0
End
Filename.b = ReadLn(FileList)
Desc.b = Readln(FileList)
End
End
DLPrompt:
call close(FileList)
Call Prompt Door,Line,WHT"Enter Filename or # ",30;v = result
If access < dlaccess then do
call Message Door,Line,"0c"x,0
Call Message Door,Line,,1
Call Message Door,Line,,1
Call Message Door,Line,RED"You do not have access to Download Files on this CD-ROM",1
Call Message Door,Line,RED"Your Access: "WHT""access""RED" Access Required: "WHT""dlaccess,1
Call Message Door,Line,,1
Call hotkey Door,Line,GRN"Press Any key to Continue..."
Call Begin
End
If datatype(v) = "NUM" then do
DLFile = FileName.v
DLFile = Strip(DLFile)
End
If datatype(v) = "CHAR" then DLFile = v
If DLFile = "NULL" then call Begin
Call SendBinFile Door,Line,Path""DLFile;Call DLPrompt
Search:
Call Prompt Door,Line,GRN"Search For: "WHT,20
searchfile=result;count=0;lines=0;found=0
if searchfile = "NULL" then call begin
Do m = 1 to f
Call Message Door,Line,"0c"x,0
call message Door,Line,WHT"Searching Area #"m""WHT" ("GRN""areadesc.m""WHT") for "WHT"'"BLU""searchfile""WHT"'...",1
call open filelist, (listpath.m), "R"
Do while ~EOF(filelist)
If upper(listtype) = "ADRTCD" then do
first=readln(filelist);last=readln(filelist)
scanline = first" "last
End
If upper(listtype) = "FILESBBS" then do
scanline = readln(filelist)
first = left(scanline,26);last = right(scanline,50)
scanline = first" "last
End
If Index(upper(scanline),upper(searchfile)) ~= 0 then do
count=count+1;lines=lines+1;found = 1
Call Message Door,Line,CYN""left(scanline,79),1
If Lines = Hight then do
Call Hotkey Door,Line,GRN"More? "WHT"("GRN"Y"WHT"/"GRN"n"WHT"/"GRN"q"WHT") "
If upper(result) = "N" then quitting = 1
If upper(result) = "Q" then do
Call close(filelist);call begin
End
If quitting = 1 then leave
Call Message Door,Line,,1
lines = 0
End
If quitting = 1 then leave
End
If quitting = 1 then leave
End
If m=f then do
If found = 0 then do
call message door,line,,1;call message door,line,BLU"Could not find '"WHT""searchfile""BLU"'",1;count = 1
End
End
lines = 0
If count > 0 then do
Call Hotkey Door,Line,GRN"Q to quit, any other key to continue...";if upper(result)="Q" then call begin
End
Call close(filelist);count=0;quitting = 0
End
call begin
NoView:
call Message Door,Line,"0c"x,0
Call Message Door,Line,,1
Call Message Door,Line,,1
Call Message Door,Line,RED"You do not have access to View Files on this CD-ROM",1
Call Message Door,Line,RED"Your Access: "WHT""access""RED" Access Required: "WHT""viewaccess,1
Call Message Door,Line,,1
Call hotkey Door,Line,GRN"Press Any key to Continue..."
Call Begin
noaccess:
call Message Door,Line,"0c"x,0
Call Message Door,Line,,1
Call Message Door,Line,,1
Call Message Door,Line,RED"You do not have access to this CD-ROM",1
Call Message Door,Line,RED"Your Access: "WHT""access""RED" Access Required: "WHT""readaccess,1
Call Message Door,Line,,1
Call hotkey Door,Line,GRN"Press Any key to Continue..."
Call Error
MakeList:
m=0
Say;Say "ADRTCDROM v2.9 (c) 1995 ADRT Software. Written by Andrew Rooney"
Say;Say 'Generating File List: 'freqlist;Say
If ~Exists(freqlist) then do;Say;Say 'Cannot find your files listing! Check your path.';say;Exit;End
if upper(line) = "GUIDE" then call GENGuide
Call Open(file,freqlist,"A")
Call Writeln(file,"-----------------------------------------------------------------------------")
Call Writeln(file,Centre("ADRTCDROM v2.9 File List (c) 1995 ADRT Software. Written by Andrew Rooney",79))
Call Writeln(file,Centre("File listing for Current CD Available",79))
Call Writeln(file,"")
Call Writeln(file,Centre(CDDesc,79))
Call Writeln(file,"-----------------------------------------------------------------------------")
Do i = 1 to f
Call Open(listing,listpath.i)
Call Writeln(file,"")
Call Writeln(file,"CD-ROM Area #"i" --> ["areadesc.i"]")
Call Writeln(file,"")
Do while ~EOF(listing)
If exists(listpath.i) then do
If upper(listtype) = "FILESBBS" then do
m = m+1
Text.m = readln(listing)
End
If upper(listtype) = "ADRTCD" then do
filename = readln(file);desc = readln(file)
m = m+1
Text.m = filename" "desc
End
End
End
Do p = 1 to m
if length(text.p) > 2 then do;call writeln(file,text.p);end
End
m=0
call close listing
End
Say "Done!"
Exit
GENGuide:
Call Open(file,freqlist,"A")
Do i = 1 to f
Call Open(listing,listpath.i)
Call Writeln(file,"AREA [CD-ROM] "areadesc.i)
Do while ~EOF(listing)
If exists(listpath.i) then do
If upper(listtype) = "FILESBBS" then do
m = m+1
Text.m = readln(listing)
if length(text.m) < 1 then leave
Parse Var Text.m filename ver size desc
size = left(size,length(size)-1)
Text.m = "FILE "filename" "size" "desc
End
If upper(listtype) = "ADRTCD" then do
filename = readln(file);desc = readln(file)
m = m+1
Text.m = filename" ?? "desc
if length(filename) < 1 then leave
End
End
End
Do p = 1 to m
if length(text.p) > 2 then do;call writeln(file,text.p);end
End
m=0
call close listing
End
Say "Done!"
Exit
ERROR:;SYNTAX:;IOERR:
Call Exit_Door Door,Line;Exit
break_c:
Say '***BREAK';say 'ADRTCDROM Exiting!';Exit